import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/doctor',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/doctor/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/doctor',
    method: 'put',
    data
  })
}

export function getByName(data) {
  return request({
    url: 'api/doctor/getByName?name=' + data
  })
}

export function getDoctorByOfficeId(officeId, pageNum, pageSize) {
  return request({
    url: 'api/doctor/getDoctorByOfficeId/' + officeId + '/' + pageNum + '/' + pageSize,
    method: 'get'
  })
}

export function addDoctor(data) {
  return request({
    url: 'api/doctor',
    method: 'post',
    data: data
  })
}

export function updateDoctor(data) {
  return request({
    url: 'api/doctor',
    method: 'put',
    data: data
  })
}

export function delDoctor(data) {
  return request({
    url: 'api/doctor',
    method: 'delete',
    data: data
  })
}

export default {add, edit, del, addDoctor, updateDoctor, delDoctor}
